/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('imarketing', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CancelOrderRequest {
  channelId?: string(name='ChannelId', example='665934690847195139'),
  tradeId?: string(name='TradeId', example='172df1fb-e3f0-4561-be77-7aa6cd12dcc9'),
}

model CancelOrderResponseBody = {
  errorCode?: string(name='ErrorCode', example='0'),
  errorMsg?: string(name='ErrorMsg'),
  ext?: map[string]any(name='Ext'),
  header?: {
    costTime?: long(name='CostTime', example='6'),
    innerErrorCode?: string(name='InnerErrorCode', example='103-002-B-001'),
    innerErrorMsg?: string(name='InnerErrorMsg'),
    rpcId?: string(name='RpcId', description='RPC ID', example='0.1.1'),
    traceId?: string(name='TraceId', example='210bc60a16915608213824028d2a16'),
    version?: string(name='Version', example='1.0'),
  }(name='Header'),
  result?: {
    requestId?: string(name='RequestId', example='565F4077-E25D-1DDF-A970-FEF3D7A05B1A'),
    success?: boolean(name='Success', example='true'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model CancelOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CancelOrderResponseBody(name='body'),
}

async function cancelOrderWithOptions(request: CancelOrderRequest, runtime: Util.RuntimeOptions): CancelOrderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.tradeId)) {
    body['TradeId'] = request.tradeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelOrder',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelOrder(request: CancelOrderRequest): CancelOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelOrderWithOptions(request, runtime);
}

model ConfirmSampleReceivedRequest {
  channelId?: string(name='ChannelId', example='665934690847195139'),
  tradeId?: string(name='TradeId', example='e293f3d3-1e51-4e60-a0bb-392a508b0c29'),
}

model ConfirmSampleReceivedResponseBody = {
  errorCode?: string(name='ErrorCode', example='0'),
  errorMsg?: string(name='ErrorMsg'),
  ext?: map[string]any(name='Ext'),
  header?: {
    costTime?: long(name='CostTime', example='51'),
    innerErrorCode?: string(name='InnerErrorCode', example='103-002-B-001'),
    innerErrorMsg?: string(name='InnerErrorMsg'),
    rpcId?: string(name='RpcId', description='RPC ID', example='0.1.1'),
    traceId?: string(name='TraceId', example='210bc60a16915517790197741d2a16'),
    version?: string(name='Version', example='1.0'),
  }(name='Header'),
  result?: {
    requestId?: string(name='RequestId', example='7ADA4EDD-7069-1252-A0FF-C6E7DB2EABD4'),
    success?: boolean(name='Success', example='true'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model ConfirmSampleReceivedResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ConfirmSampleReceivedResponseBody(name='body'),
}

async function confirmSampleReceivedWithOptions(request: ConfirmSampleReceivedRequest, runtime: Util.RuntimeOptions): ConfirmSampleReceivedResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.tradeId)) {
    body['TradeId'] = request.tradeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ConfirmSampleReceived',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function confirmSampleReceived(request: ConfirmSampleReceivedRequest): ConfirmSampleReceivedResponse {
  var runtime = new Util.RuntimeOptions{};
  return confirmSampleReceivedWithOptions(request, runtime);
}

model ConfirmSampleShippedRequest {
  buyerAddress?: string(name='BuyerAddress'),
  buyerName?: string(name='BuyerName'),
  buyerPhoneNumber?: string(name='BuyerPhoneNumber', example='13988888888'),
  channelId?: string(name='ChannelId', example='665934690847195139'),
  tradeId?: string(name='TradeId', example='8607f977-20eb-438f-957e-72d6df43ef8f'),
}

model ConfirmSampleShippedResponseBody = {
  errorCode?: string(name='ErrorCode', example='0'),
  errorMsg?: string(name='ErrorMsg'),
  ext?: map[string]any(name='Ext'),
  header?: {
    costTime?: long(name='CostTime', example='11'),
    innerErrorCode?: string(name='InnerErrorCode', example='103-002-B-001'),
    innerErrorMsg?: string(name='InnerErrorMsg'),
    rpcId?: string(name='RpcId', description='RPC ID', example='0.1.1'),
    traceId?: string(name='TraceId', example='06914b9a6c454884dc9385066fdb41d2'),
    version?: string(name='Version', example='1.0'),
  }(name='Header'),
  result?: {
    requestId?: string(name='RequestId', example='E737D6A2-1D50-11C0-8286-B652CD1C20D1'),
    success?: boolean(name='Success', example='true'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model ConfirmSampleShippedResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ConfirmSampleShippedResponseBody(name='body'),
}

async function confirmSampleShippedWithOptions(request: ConfirmSampleShippedRequest, runtime: Util.RuntimeOptions): ConfirmSampleShippedResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.buyerAddress)) {
    body['BuyerAddress'] = request.buyerAddress;
  }
  if (!Util.isUnset(request.buyerName)) {
    body['BuyerName'] = request.buyerName;
  }
  if (!Util.isUnset(request.buyerPhoneNumber)) {
    body['BuyerPhoneNumber'] = request.buyerPhoneNumber;
  }
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.tradeId)) {
    body['TradeId'] = request.tradeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ConfirmSampleShipped',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function confirmSampleShipped(request: ConfirmSampleShippedRequest): ConfirmSampleShippedResponse {
  var runtime = new Util.RuntimeOptions{};
  return confirmSampleShippedWithOptions(request, runtime);
}

model CreateDeviceRequest {
  channelId?: string(name='ChannelId', example='747469885047067648'),
  city?: string(name='City'),
  deviceModelNumber?: string(name='DeviceModelNumber', example='3306196'),
  deviceName?: string(name='DeviceName', example='ETCPPARK'),
  deviceType?: string(name='DeviceType', example='android'),
  district?: string(name='District'),
  extraMap?: map[string]any(name='ExtraMap'),
  firstScene?: string(name='FirstScene'),
  floor?: string(name='Floor'),
  locationName?: string(name='LocationName'),
  mediaId?: string(name='MediaId', example='707566617274263557'),
  outerCode?: string(name='OuterCode', example='9305102437'),
  province?: string(name='Province'),
  secondScene?: string(name='SecondScene', example='CBD'),
}

model CreateDeviceShrinkRequest {
  channelId?: string(name='ChannelId', example='747469885047067648'),
  city?: string(name='City'),
  deviceModelNumber?: string(name='DeviceModelNumber', example='3306196'),
  deviceName?: string(name='DeviceName', example='ETCPPARK'),
  deviceType?: string(name='DeviceType', example='android'),
  district?: string(name='District'),
  extraMapShrink?: string(name='ExtraMap'),
  firstScene?: string(name='FirstScene'),
  floor?: string(name='Floor'),
  locationName?: string(name='LocationName'),
  mediaId?: string(name='MediaId', example='707566617274263557'),
  outerCode?: string(name='OuterCode', example='9305102437'),
  province?: string(name='Province'),
  secondScene?: string(name='SecondScene', example='CBD'),
}

model CreateDeviceResponseBody = {
  code?: string(name='Code', description='Id of the request', example='200'),
  message?: string(name='Message', example='Success'),
  model?: string(name='Model', example='784422933136765953'),
  requestId?: string(name='RequestId', description='Id of the request', example='ea1a40002116661614863891490d0074'),
  success?: boolean(name='Success', example='True'),
}

model CreateDeviceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateDeviceResponseBody(name='body'),
}

async function createDeviceWithOptions(tmpReq: CreateDeviceRequest, runtime: Util.RuntimeOptions): CreateDeviceResponse {
  Util.validateModel(tmpReq);
  var request = new CreateDeviceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extraMap)) {
    request.extraMapShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extraMap, 'ExtraMap', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.city)) {
    body['City'] = request.city;
  }
  if (!Util.isUnset(request.deviceModelNumber)) {
    body['DeviceModelNumber'] = request.deviceModelNumber;
  }
  if (!Util.isUnset(request.deviceName)) {
    body['DeviceName'] = request.deviceName;
  }
  if (!Util.isUnset(request.deviceType)) {
    body['DeviceType'] = request.deviceType;
  }
  if (!Util.isUnset(request.district)) {
    body['District'] = request.district;
  }
  if (!Util.isUnset(request.extraMapShrink)) {
    body['ExtraMap'] = request.extraMapShrink;
  }
  if (!Util.isUnset(request.firstScene)) {
    body['FirstScene'] = request.firstScene;
  }
  if (!Util.isUnset(request.floor)) {
    body['Floor'] = request.floor;
  }
  if (!Util.isUnset(request.locationName)) {
    body['LocationName'] = request.locationName;
  }
  if (!Util.isUnset(request.mediaId)) {
    body['MediaId'] = request.mediaId;
  }
  if (!Util.isUnset(request.outerCode)) {
    body['OuterCode'] = request.outerCode;
  }
  if (!Util.isUnset(request.province)) {
    body['Province'] = request.province;
  }
  if (!Util.isUnset(request.secondScene)) {
    body['SecondScene'] = request.secondScene;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDevice',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDevice(request: CreateDeviceRequest): CreateDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDeviceWithOptions(request, runtime);
}

model DeleteCreativeInfoRequest {
  accountNo?: string(name='AccountNo'),
  bizId?: string(name='BizId'),
  id?: long(name='Id', example='1'),
  mainId?: long(name='MainId'),
  updateUser?: string(name='UpdateUser'),
}

model DeleteCreativeInfoResponseBody = {
  code?: int32(name='Code'),
  data?: boolean(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteCreativeInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteCreativeInfoResponseBody(name='body'),
}

async function deleteCreativeInfoWithOptions(request: DeleteCreativeInfoRequest, runtime: Util.RuntimeOptions): DeleteCreativeInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountNo)) {
    query['AccountNo'] = request.accountNo;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.mainId)) {
    query['MainId'] = request.mainId;
  }
  if (!Util.isUnset(request.updateUser)) {
    query['UpdateUser'] = request.updateUser;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCreativeInfo',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteCreativeInfo(request: DeleteCreativeInfoRequest): DeleteCreativeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCreativeInfoWithOptions(request, runtime);
}

model GetAdvertisingForE2ResponseBody = {
  errorCode?: string(name='ErrorCode', description='errorCode', example='200'),
  errorMsg?: string(name='ErrorMsg', description='errorMsg'),
  header?: {
    costTime?: long(name='CostTime', description='costTime', example='51'),
    innerErrorCode?: string(name='InnerErrorCode', description='innerErrorCode', example='103-002-B-001'),
    innerErrorMsg?: string(name='InnerErrorMsg', description='innerErrorMsg'),
    rpcId?: string(name='RpcId', description='rpcId', example='0.1.1'),
    traceId?: string(name='TraceId', description='traceId', example='0bc1ec4216798984196977133e7f62'),
    version?: string(name='Version', description='version', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
  }(name='Header', description='header'),
  requestId?: string(name='RequestId', example='A53EB3C4-DD25-5B90-9029-4A414877CFFB'),
  result?: {
    imgUrl?: string(name='ImgUrl'),
    targetUrl?: string(name='TargetUrl', example='https://********'),
  }(name='Result'),
  success?: boolean(name='Success', description='success', example='True'),
}

model GetAdvertisingForE2Response = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAdvertisingForE2ResponseBody(name='body'),
}

async function getAdvertisingForE2WithOptions(runtime: Util.RuntimeOptions): GetAdvertisingForE2Response {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetAdvertisingForE2',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAdvertisingForE2(): GetAdvertisingForE2Response {
  var runtime = new Util.RuntimeOptions{};
  return getAdvertisingForE2WithOptions(runtime);
}

model GetBrandPageRequest {
  accountNo?: string(name='AccountNo'),
  mainId?: long(name='MainId', example='162667949547700'),
  mainName?: string(name='MainName'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model GetBrandPageResponseBody = {
  code?: long(name='Code'),
  data?: {
    list?: [ 
      {
        accountNo?: string(name='AccountNo'),
        accountType?: string(name='AccountType'),
        company?: string(name='Company'),
        mainId?: long(name='MainId'),
        mainName?: string(name='MainName'),
        parentMainId?: long(name='ParentMainId'),
      }
    ](name='List'),
    pageInfo?: {
      page?: int32(name='Page', example='1'),
      pageSize?: int32(name='PageSize', example='10'),
      totalNumber?: int32(name='TotalNumber', example='1000'),
    }(name='PageInfo'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetBrandPageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetBrandPageResponseBody(name='body'),
}

async function getBrandPageWithOptions(request: GetBrandPageRequest, runtime: Util.RuntimeOptions): GetBrandPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountNo)) {
    query['AccountNo'] = request.accountNo;
  }
  if (!Util.isUnset(request.mainId)) {
    query['MainId'] = request.mainId;
  }
  if (!Util.isUnset(request.mainName)) {
    query['MainName'] = request.mainName;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBrandPage',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBrandPage(request: GetBrandPageRequest): GetBrandPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBrandPageWithOptions(request, runtime);
}

model GetBusinessIdRequest {
  businessId?: string(name='BusinessId'),
}

model GetBusinessIdResponseBody = {
  code?: int32(name='Code'),
  data?: string(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetBusinessIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetBusinessIdResponseBody(name='body'),
}

async function getBusinessIdWithOptions(request: GetBusinessIdRequest, runtime: Util.RuntimeOptions): GetBusinessIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessId)) {
    query['BusinessId'] = request.businessId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBusinessId',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBusinessId(request: GetBusinessIdRequest): GetBusinessIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBusinessIdWithOptions(request, runtime);
}

model GetCreativeInfoRequest {
  accountNo?: string(name='AccountNo'),
  bizId?: string(name='BizId'),
  id?: long(name='Id', example='1'),
  mainId?: long(name='MainId'),
}

model GetCreativeInfoResponseBody = {
  code?: int32(name='Code'),
  data?: {
    accountNo?: string(name='AccountNo'),
    chainValue?: string(name='ChainValue'),
    componentIdList?: string(name='ComponentIdList'),
    id?: int32(name='Id'),
    mainId?: long(name='MainId'),
    name?: string(name='Name'),
    pageId?: string(name='PageId'),
    status?: int32(name='Status'),
    taskCount?: int32(name='TaskCount'),
    url?: string(name='Url'),
    urlType?: string(name='UrlType'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetCreativeInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCreativeInfoResponseBody(name='body'),
}

async function getCreativeInfoWithOptions(request: GetCreativeInfoRequest, runtime: Util.RuntimeOptions): GetCreativeInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountNo)) {
    query['AccountNo'] = request.accountNo;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.mainId)) {
    query['MainId'] = request.mainId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCreativeInfo',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCreativeInfo(request: GetCreativeInfoRequest): GetCreativeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreativeInfoWithOptions(request, runtime);
}

model GetLeadsListPageRequest {
  componentId?: long(name='ComponentId'),
  contentId?: long(name='ContentId'),
  creativeId?: long(name='CreativeId'),
  endTime?: long(name='EndTime'),
  mainId?: long(name='MainId'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  startTime?: long(name='StartTime'),
  taskId?: long(name='TaskId'),
}

model GetLeadsListPageResponseBody = {
  code?: int32(name='Code'),
  data?: {
    list?: [ 
      {
        componentId?: string(name='ComponentId'),
        contentId?: long(name='ContentId'),
        creativeId?: int32(name='CreativeId'),
        creativeName?: string(name='CreativeName'),
        leadsDetail?: string(name='LeadsDetail'),
        serialId?: long(name='SerialId'),
        taskId?: long(name='TaskId'),
      }
    ](name='List'),
    pageInfo?: {
      page?: int32(name='Page'),
      pageSize?: int32(name='PageSize'),
      totalNumber?: int32(name='TotalNumber'),
    }(name='PageInfo'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetLeadsListPageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetLeadsListPageResponseBody(name='body'),
}

async function getLeadsListPageWithOptions(request: GetLeadsListPageRequest, runtime: Util.RuntimeOptions): GetLeadsListPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.componentId)) {
    query['ComponentId'] = request.componentId;
  }
  if (!Util.isUnset(request.contentId)) {
    query['ContentId'] = request.contentId;
  }
  if (!Util.isUnset(request.creativeId)) {
    query['CreativeId'] = request.creativeId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.mainId)) {
    query['MainId'] = request.mainId;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetLeadsListPage',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getLeadsListPage(request: GetLeadsListPageRequest): GetLeadsListPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getLeadsListPageWithOptions(request, runtime);
}

model GetMainPartPageRequest {
  mainId?: long(name='MainId', example='162859085538403'),
  mainName?: string(name='MainName'),
  pageIndex?: int32(name='PageIndex', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model GetMainPartPageResponseBody = {
  code?: long(name='Code'),
  data?: {
    list?: [ 
      {
        accountTypeList?: [ 
          {
            accountType?: string(name='AccountType'),
            accountTypeDesc?: string(name='AccountTypeDesc'),
          }
        ](name='AccountTypeList'),
        company?: string(name='Company'),
        mainId?: long(name='MainId'),
        mainName?: string(name='MainName'),
      }
    ](name='List'),
    pageInfo?: {
      page?: int32(name='Page', example='1'),
      pageSize?: int32(name='PageSize', example='10'),
      totalNumber?: int32(name='TotalNumber', example='1000'),
    }(name='PageInfo'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetMainPartPageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMainPartPageResponseBody(name='body'),
}

async function getMainPartPageWithOptions(request: GetMainPartPageRequest, runtime: Util.RuntimeOptions): GetMainPartPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mainId)) {
    query['MainId'] = request.mainId;
  }
  if (!Util.isUnset(request.mainName)) {
    query['MainName'] = request.mainName;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMainPartPage',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMainPartPage(request: GetMainPartPageRequest): GetMainPartPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMainPartPageWithOptions(request, runtime);
}

model GetOssUploadSignatureRequest {
  fileName?: string(name='FileName'),
  fileType?: string(name='FileType'),
}

model GetOssUploadSignatureResponseBody = {
  data?: {
    accessKeyId?: string(name='AccessKeyId'),
    expire?: string(name='Expire'),
    host?: string(name='Host'),
    ossKey?: string(name='OssKey'),
    policy?: string(name='Policy'),
    signature?: string(name='Signature'),
  }(name='Data'),
  errorCode?: int32(name='ErrorCode'),
  httpCode?: int32(name='HttpCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetOssUploadSignatureResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOssUploadSignatureResponseBody(name='body'),
}

async function getOssUploadSignatureWithOptions(request: GetOssUploadSignatureRequest, runtime: Util.RuntimeOptions): GetOssUploadSignatureResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOssUploadSignature',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOssUploadSignature(request: GetOssUploadSignatureRequest): GetOssUploadSignatureResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOssUploadSignatureWithOptions(request, runtime);
}

model GetRelatedByCreativeIdRequest {
  id?: int32(name='Id'),
}

model GetRelatedByCreativeIdResponseBody = {
  code?: int32(name='Code'),
  data?: [ 
    {
      contentId?: long(name='ContentId'),
      contentName?: string(name='ContentName'),
      taskId?: long(name='TaskId'),
      taskName?: string(name='TaskName'),
    }
  ](name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetRelatedByCreativeIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetRelatedByCreativeIdResponseBody(name='body'),
}

async function getRelatedByCreativeIdWithOptions(request: GetRelatedByCreativeIdRequest, runtime: Util.RuntimeOptions): GetRelatedByCreativeIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetRelatedByCreativeId',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRelatedByCreativeId(request: GetRelatedByCreativeIdRequest): GetRelatedByCreativeIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRelatedByCreativeIdWithOptions(request, runtime);
}

model GetUserFinishedAdRequest {
  adid?: long(name='Adid'),
  clicklink?: string(name='Clicklink'),
  id?: string(name='Id'),
  mediaid?: string(name='Mediaid'),
  tagid?: string(name='Tagid'),
  uid?: string(name='Uid'),
}

model GetUserFinishedAdResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  ext?: map[string]string(name='Ext'),
  header?: {
    costTime?: long(name='CostTime'),
    rpcId?: string(name='RpcId'),
    traceId?: string(name='TraceId'),
    version?: string(name='Version'),
  }(name='Header'),
  requestId?: string(name='RequestId'),
  result?: {
    commission?: string(name='Commission'),
    id?: string(name='Id'),
    marketingType?: string(name='MarketingType'),
    objective?: string(name='Objective'),
    success?: boolean(name='Success'),
  }(name='Result'),
  success?: boolean(name='Success'),
}

model GetUserFinishedAdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUserFinishedAdResponseBody(name='body'),
}

async function getUserFinishedAdWithOptions(request: GetUserFinishedAdRequest, runtime: Util.RuntimeOptions): GetUserFinishedAdResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserFinishedAd',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserFinishedAd(request: GetUserFinishedAdRequest): GetUserFinishedAdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserFinishedAdWithOptions(request, runtime);
}

model ListAdvertisingRequest {
  app?: {
    appid?: string(name='Appid'),
    ext?: map[string]any(name='Ext'),
    mediaid?: string(name='Mediaid'),
    sn?: string(name='Sn'),
  }(name='App'),
  dealtype?: int32(name='Dealtype'),
  device?: {
    androidid?: string(name='Androidid'),
    androidmd5?: string(name='Androidmd5'),
    caid?: string(name='Caid'),
    carrier?: string(name='Carrier'),
    connectiontype?: int32(name='Connectiontype'),
    devicetype?: int32(name='Devicetype'),
    geo?: {
      city?: string(name='City'),
      district?: string(name='District'),
      lat?: double(name='Lat'),
      lon?: double(name='Lon'),
      province?: string(name='Province'),
    }(name='Geo'),
    idfa?: string(name='Idfa'),
    imei?: string(name='Imei'),
    imeimd5?: string(name='Imeimd5'),
    ip?: string(name='Ip'),
    language?: string(name='Language'),
    mac?: string(name='Mac'),
    macmd5?: string(name='Macmd5'),
    make?: string(name='Make'),
    model?: string(name='Model'),
    oaid?: string(name='Oaid'),
    os?: string(name='Os'),
    osv?: string(name='Osv'),
    ua?: string(name='Ua'),
    utdid?: string(name='Utdid'),
  }(name='Device'),
  ext?: map[string]any(name='Ext'),
  id?: string(name='Id'),
  imp?: [ 
    {
      id?: string(name='Id'),
      tagid?: string(name='Tagid'),
    }
  ](name='Imp'),
  test?: int32(name='Test'),
  user?: {
    id?: string(name='Id'),
    usertype?: string(name='Usertype'),
  }(name='User'),
}

model ListAdvertisingShrinkRequest {
  appShrink?: string(name='App'),
  dealtype?: int32(name='Dealtype'),
  deviceShrink?: string(name='Device'),
  extShrink?: string(name='Ext'),
  id?: string(name='Id'),
  impShrink?: string(name='Imp'),
  test?: int32(name='Test'),
  userShrink?: string(name='User'),
}

model ListAdvertisingResponseBody = {
  errorcode?: string(name='Errorcode'),
  errormsg?: string(name='Errormsg'),
  ext?: map[string]string(name='Ext'),
  header?: {
    costTime?: long(name='CostTime'),
    rpcId?: string(name='RpcId'),
    traceId?: string(name='TraceId'),
    version?: string(name='Version'),
  }(name='Header'),
  requestId?: string(name='RequestId'),
  result?: {
    bidid?: string(name='Bidid'),
    id?: string(name='Id'),
    seatbid?: [ 
      {
        bid?: [ 
          {
            ads?: [ 
              {
                crid?: string(name='Crid'),
                crurl?: string(name='Crurl'),
                icon?: {
                  url?: string(name='Url'),
                }(name='Icon'),
                id?: string(name='Id'),
                images?: [ 
                  {
                    desc?: string(name='Desc'),
                    format?: string(name='Format'),
                    url?: string(name='Url'),
                  }
                ](name='Images'),
                interacttype?: int32(name='Interacttype'),
                labeltype?: string(name='Labeltype'),
                landingurls?: [ string ](name='Landingurls'),
                marketingtype?: string(name='Marketingtype'),
                objective?: string(name='Objective'),
                price?: string(name='Price'),
                seat?: string(name='Seat'),
                style?: string(name='Style'),
                title?: string(name='Title'),
                trackers?: {
                  imps?: [ string ](name='Imps'),
                }(name='Trackers'),
                type?: string(name='Type'),
              }
            ](name='Ads'),
            impid?: string(name='Impid'),
          }
        ](name='Bid'),
      }
    ](name='Seatbid'),
  }(name='Result'),
  success?: boolean(name='Success'),
}

model ListAdvertisingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAdvertisingResponseBody(name='body'),
}

async function listAdvertisingWithOptions(tmpReq: ListAdvertisingRequest, runtime: Util.RuntimeOptions): ListAdvertisingResponse {
  Util.validateModel(tmpReq);
  var request = new ListAdvertisingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.device)) {
    request.deviceShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.device, 'Device', 'json');
  }
  if (!Util.isUnset(tmpReq.ext)) {
    request.extShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ext, 'Ext', 'json');
  }
  if (!Util.isUnset(tmpReq.imp)) {
    request.impShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.imp, 'Imp', 'json');
  }
  if (!Util.isUnset(tmpReq.user)) {
    request.userShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.user, 'User', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAdvertising',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAdvertising(request: ListAdvertisingRequest): ListAdvertisingResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAdvertisingWithOptions(request, runtime);
}

model ListSpecificAdRequest {
  app?: {
    ext?: map[string]any(name='Ext', description='ext', example='{\\"cxyAppName\\":\\"aliInstantAppMRCJ\\",\\"cxyUserType\\":\\"cxyAliInstantApp\\",\\"openId\\":\\"2088412404350201\\",\\"cxyUserId\\":\\"894464ABFC054B51AD971DFBDB97D9C0\\"}'),
    mediaid?: string(name='Mediaid', description='mediaid', example='234546546'),
    sn?: string(name='Sn', description='sn', example='testSn'),
  }(name='App', description='app'),
  ext?: map[string]any(name='Ext', example='{\\"cxyAppName\\":\\"aliInstantAppMRCJ\\",\\"cxyUserType\\":\\"cxyAliInstantApp\\",\\"openId\\":\\"2088412404350201\\",\\"cxyUserId\\":\\"894464ABFC054B51AD971DFBDB97D9C0\\"}'),
  id?: string(name='Id', description='id', example='acbef-345-6546'),
  imp?: [ 
    {
      id?: string(name='Id', description='id', example='74'),
      tagid?: string(name='Tagid', description='tagid', example='7857789563'),
    }
  ](name='Imp', description='imp'),
  user?: {
    id?: string(name='Id', description='uid', example='76403197902848'),
    usertype?: string(name='Usertype', description='uidtype', example='ALIPAY_OPEN_ID'),
  }(name='User', description='user'),
  verifyad?: [ 
    {
      id?: string(name='Id', description='id', example='76403197902848'),
      itemid?: string(name='Itemid', example='242323'),
      marketingtype?: string(name='Marketingtype', example='brandDispatch'),
      seat?: string(name='Seat', example='4534523'),
    }
  ](name='Verifyad'),
}

model ListSpecificAdShrinkRequest {
  appShrink?: string(name='App', description='app'),
  extShrink?: string(name='Ext', example='{\\"cxyAppName\\":\\"aliInstantAppMRCJ\\",\\"cxyUserType\\":\\"cxyAliInstantApp\\",\\"openId\\":\\"2088412404350201\\",\\"cxyUserId\\":\\"894464ABFC054B51AD971DFBDB97D9C0\\"}'),
  id?: string(name='Id', description='id', example='acbef-345-6546'),
  impShrink?: string(name='Imp', description='imp'),
  userShrink?: string(name='User', description='user'),
  verifyadShrink?: string(name='Verifyad'),
}

model ListSpecificAdResponseBody = {
  errorcode?: string(name='Errorcode', description='errorCode', example='P1001'),
  errormsg?: string(name='Errormsg', description='errorMsg', example='error'),
  ext?: map[string]string(name='Ext', description='ext'),
  header?: {
    costTime?: long(name='CostTime', description='costTime', example='15'),
    rpcId?: string(name='RpcId', description='rpcId', example='xhx3mwagszdxb5lf'),
    traceId?: string(name='TraceId', description='traceId', example='xhx3mwa'),
    version?: string(name='Version', description='version', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
  }(name='Header', description='header'),
  requestId?: string(name='RequestId', example='7ADA4EDD-7069-1252-A0FF-C6E7DB2EABD4'),
  result?: {
    bidid?: string(name='Bidid', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
    id?: string(name='Id', description='id', example='32'),
    seatbid?: [ 
      {
        bid?: [ 
          {
            ads?: [ 
              {
                crid?: string(name='Crid', description='crid', example='23435345'),
                crurl?: string(name='Crurl', example='www.taobao.com'),
                icon?: {
                  url?: string(name='Url', example='https://market.m.taobao.com/app/alicloud-tools/base-h5/index.html?rootId=16022413&appId=100100100100&pageId=page_0d884ec7&BusinessId=yc-165407506207478-165511576113195&preview=true&cid=32'),
                }(name='Icon'),
                id?: string(name='Id', example='51313927061504'),
                interacttype?: int32(name='Interacttype', description='Interacttype', example='1'),
                itemid?: string(name='Itemid', example='234543'),
                labeltype?: string(name='Labeltype'),
                landingurls?: [ string ](name='Landingurls'),
                marketingtype?: string(name='Marketingtype', example='OnlineStoreMember'),
                objective?: string(name='Objective', example='SINGLE_ACQUISITION'),
                price?: string(name='Price', example='69.0'),
                seat?: string(name='Seat', description='seat', example='645534523'),
                title?: string(name='Title'),
                trackers?: {
                  imps?: [ string ](name='Imps'),
                }(name='Trackers'),
              }
            ](name='Ads', description='ad'),
            impid?: string(name='Impid', description='impId', example='53453423'),
          }
        ](name='Bid', description='Bid'),
      }
    ](name='Seatbid', description='seat'),
  }(name='Result'),
  success?: boolean(name='Success', description='success', example='True'),
}

model ListSpecificAdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSpecificAdResponseBody(name='body'),
}

async function listSpecificAdWithOptions(tmpReq: ListSpecificAdRequest, runtime: Util.RuntimeOptions): ListSpecificAdResponse {
  Util.validateModel(tmpReq);
  var request = new ListSpecificAdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.ext)) {
    request.extShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ext, 'Ext', 'json');
  }
  if (!Util.isUnset(tmpReq.imp)) {
    request.impShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.imp, 'Imp', 'json');
  }
  if (!Util.isUnset(tmpReq.user)) {
    request.userShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.user, 'User', 'json');
  }
  if (!Util.isUnset(tmpReq.verifyad)) {
    request.verifyadShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.verifyad, 'Verifyad', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.extShrink)) {
    query['Ext'] = request.extShrink;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.impShrink)) {
    query['Imp'] = request.impShrink;
  }
  if (!Util.isUnset(request.userShrink)) {
    query['User'] = request.userShrink;
  }
  if (!Util.isUnset(request.verifyadShrink)) {
    query['Verifyad'] = request.verifyadShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSpecificAd',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listSpecificAd(request: ListSpecificAdRequest): ListSpecificAdResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSpecificAdWithOptions(request, runtime);
}

model QueryAuditResultRequest {
  dspId?: string(name='DspId'),
  ids?: [ string ](name='Ids'),
}

model QueryAuditResultResponseBody = {
  message?: string(name='Message'),
  records?: [ 
    {
      crid?: string(name='Crid'),
      reason?: string(name='Reason'),
      state?: int32(name='State'),
    }
  ](name='Records'),
  requestId?: string(name='RequestId'),
  status?: int32(name='Status'),
  total?: int32(name='Total'),
}

model QueryAuditResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAuditResultResponseBody(name='body'),
}

async function queryAuditResultWithOptions(request: QueryAuditResultRequest, runtime: Util.RuntimeOptions): QueryAuditResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dspId)) {
    query['DspId'] = request.dspId;
  }
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAuditResult',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAuditResult(request: QueryAuditResultRequest): QueryAuditResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAuditResultWithOptions(request, runtime);
}

model QueryBenefitGrantResultRequest {
  cloducodeFlowNo?: string(name='CloducodeFlowNo', example='12345'),
  outerCustomerId?: string(name='OuterCustomerId'),
}

model QueryBenefitGrantResultResponseBody = {
  code?: string(name='Code', description='Id of the request', example='200'),
  debug?: boolean(name='Debug', description='123', example='true'),
  message?: string(name='Message', example='Success'),
  model?: {
    amount?: long(name='Amount', example='2'),
    cloudcodeFlowNo?: string(name='CloudcodeFlowNo', description='12345', example='123'),
    outerCustomerId?: string(name='OuterCustomerId', description='12345', example='123'),
    outerFlowNo?: string(name='OuterFlowNo', description='12345', example='123'),
    remark?: string(name='Remark'),
    status?: int32(name='Status', example='0'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='A53EB3C4-DD25-5B90-9029-4A414877CFFB'),
  success?: boolean(name='Success', example='True'),
}

model QueryBenefitGrantResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryBenefitGrantResultResponseBody(name='body'),
}

async function queryBenefitGrantResultWithOptions(request: QueryBenefitGrantResultRequest, runtime: Util.RuntimeOptions): QueryBenefitGrantResultResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cloducodeFlowNo)) {
    body['CloducodeFlowNo'] = request.cloducodeFlowNo;
  }
  if (!Util.isUnset(request.outerCustomerId)) {
    body['OuterCustomerId'] = request.outerCustomerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryBenefitGrantResult',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryBenefitGrantResult(request: QueryBenefitGrantResultRequest): QueryBenefitGrantResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBenefitGrantResultWithOptions(request, runtime);
}

model QueryFinanceUserInfoRequest {
  activityId?: long(name='ActivityId', example='1'),
  userId?: long(name='UserId', example='1'),
}

model QueryFinanceUserInfoResponseBody = {
  errorCode?: string(name='ErrorCode', example='0'),
  errorMsg?: string(name='ErrorMsg'),
  ext?: map[string]string(name='Ext'),
  header?: {
    costTime?: long(name='CostTime', example='19'),
    innerErrorCode?: string(name='InnerErrorCode', example='1'),
    innerErrorMsg?: string(name='InnerErrorMsg'),
    rpcId?: string(name='RpcId', description='RPC ID', example='0.1.1'),
    traceId?: string(name='TraceId', example='123456'),
    version?: string(name='Version', example='10'),
  }(name='Header'),
  result?: {
    requestId?: string(name='RequestId', example='123456'),
    totalIncomeAmount?: long(name='TotalIncomeAmount', example='100'),
    userPageType?: string(name='UserPageType', example='A'),
    yesterdayIncomeAmount?: long(name='YesterdayIncomeAmount', example='100'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model QueryFinanceUserInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryFinanceUserInfoResponseBody(name='body'),
}

async function queryFinanceUserInfoWithOptions(request: QueryFinanceUserInfoRequest, runtime: Util.RuntimeOptions): QueryFinanceUserInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.activityId)) {
    body['ActivityId'] = request.activityId;
  }
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryFinanceUserInfo',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryFinanceUserInfo(request: QueryFinanceUserInfoRequest): QueryFinanceUserInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryFinanceUserInfoWithOptions(request, runtime);
}

model QueryOrderRequest {
  channelId?: string(name='ChannelId', example='665934690847195139'),
  channelTradeId?: string(name='ChannelTradeId', example='202308101'),
  tradeId?: string(name='TradeId', example='bb7b39c7-4982-41af-8158-1a694b40cf2a'),
}

model QueryOrderResponseBody = {
  errorCode?: string(name='ErrorCode', example='0'),
  errorMsg?: string(name='ErrorMsg'),
  ext?: map[string]any(name='Ext'),
  header?: {
    costTime?: long(name='CostTime', example='8'),
    innerErrorCode?: string(name='InnerErrorCode', example='103-002-B-001'),
    innerErrorMsg?: string(name='InnerErrorMsg'),
    rpcId?: string(name='RpcId', description='RPC ID', example='0.1.1'),
    traceId?: string(name='TraceId', example='2103a00316915740246995934d0200'),
    version?: string(name='Version', example='1'),
  }(name='Header'),
  result?: {
    alipayTradeId?: string(name='AlipayTradeId', example='2023080922001195790515238438'),
    channelTradeId?: string(name='ChannelTradeId', example='202308101'),
    itemId?: long(name='ItemId', example='732766164666'),
    modifiedTime?: long(name='ModifiedTime', example='1691636782919'),
    orderStatus?: int32(name='OrderStatus', example='0'),
    price?: long(name='Price', example='50'),
    requestId?: string(name='RequestId', example='2BDF2EA5-DD3D-171D-AB54-A9EC7DA1008F'),
    success?: boolean(name='Success', example='true'),
    taobaoTradeId?: string(name='TaobaoTradeId', example='3469791531013613461'),
    tradeId?: string(name='TradeId', example='bb7b39c7-4982-41af-8158-1a694b40cf2a'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model QueryOrderResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryOrderResponseBody(name='body'),
}

async function queryOrderWithOptions(request: QueryOrderRequest, runtime: Util.RuntimeOptions): QueryOrderResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channelId)) {
    body['ChannelId'] = request.channelId;
  }
  if (!Util.isUnset(request.channelTradeId)) {
    body['ChannelTradeId'] = request.channelTradeId;
  }
  if (!Util.isUnset(request.tradeId)) {
    body['TradeId'] = request.tradeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryOrder',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryOrder(request: QueryOrderRequest): QueryOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryOrderWithOptions(request, runtime);
}

model ReportImpressionRequest {
  impressionlink?: string(name='Impressionlink', description='impressionlink', example='2cdf86c6c3cd7947a450ea3e9031b9ecbf8921389a9fcf96e575276400c70991b6268ab8c154bd3c638eaf58336c1cde72239c7134a3fe0f8d692ff924e2460d26c35fb0cf8f98cde03f8380b50e442f9af83ab7ba7013dd69c69d4993af8993237b1d1aae4262b4acd66be7b561720bd24a4f4715d93987e434e198c8a99286bf04a56389893336ce96680e5198b34ef32579d2d0e2e261c10ae651642d'),
}

model ReportImpressionResponseBody = {
  errorCode?: string(name='ErrorCode', description='errorCode', example='P1008'),
  errorMsg?: string(name='ErrorMsg', description='errorMsg'),
  ext?: map[string]string(name='Ext', description='ext'),
  header?: {
    costTime?: long(name='CostTime', description='costTime', example='15'),
    rpcId?: string(name='RpcId', description='rpcId', example='xhx3mwagszdxb5lf'),
    traceId?: string(name='TraceId', description='traceId', example='xhx3mwa'),
    version?: string(name='Version', description='version', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
  }(name='Header', description='header'),
  requestId?: string(name='RequestId', example='A53EB3C4-DD25-5B90-9029-4A414877CFFB'),
  result?: {
    bidid?: string(name='Bidid', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
    success?: boolean(name='Success', example='true'),
  }(name='Result'),
  success?: boolean(name='Success', description='success', example='true'),
}

model ReportImpressionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReportImpressionResponseBody(name='body'),
}

async function reportImpressionWithOptions(request: ReportImpressionRequest, runtime: Util.RuntimeOptions): ReportImpressionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.impressionlink)) {
    query['Impressionlink'] = request.impressionlink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportImpression',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportImpression(request: ReportImpressionRequest): ReportImpressionResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportImpressionWithOptions(request, runtime);
}

model ReportTranslateRequest {
  impressionlink?: string(name='Impressionlink', example='2cdf86c6c3cd7947a450ea3e9031b9ecbf8921389a9fcf96e575276400c70991b6268ab8c154bd3c638eaf58336c1cde72239c7134a3fe0f8d692ff924e2460d26c35fb0cf8f98cde03f8380b50e442f9af83ab7ba7013dd69c69d4993af8993237b1d1aae4262b4acd66be7b561720bd24a4f4715d93987e434e198c8a99286bf04a56389893336ce96680e5198b34ef32579d2d0e2e261c10ae651642d'),
}

model ReportTranslateResponseBody = {
  errorCode?: string(name='ErrorCode', description='errorCode', example='P1008'),
  errorMsg?: string(name='ErrorMsg', description='errorMsg'),
  header?: {
    costTime?: long(name='CostTime', description='costTime', example='19'),
    innerErrorCode?: string(name='InnerErrorCode', description='innerErrorCode', example='P1000'),
    innerErrorMsg?: string(name='InnerErrorMsg', description='innerErrorMsg'),
    rpcId?: string(name='RpcId', description='rpcId', example='xhx3mwagszdxb5lf'),
    traceId?: string(name='TraceId', description='traceId', example='xhx3mwa'),
    version?: string(name='Version', description='version', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
  }(name='Header', description='header'),
  requestId?: string(name='RequestId', example='A53EB3C4-DD25-5B90-9029-4A414877CFFB'),
  result?: {
    bidid?: string(name='Bidid', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
    success?: string(name='Success', description='success', example='True'),
  }(name='Result'),
  success?: boolean(name='Success', description='success', example='True'),
}

model ReportTranslateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReportTranslateResponseBody(name='body'),
}

async function reportTranslateWithOptions(request: ReportTranslateRequest, runtime: Util.RuntimeOptions): ReportTranslateResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportTranslate',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportTranslate(request: ReportTranslateRequest): ReportTranslateResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportTranslateWithOptions(request, runtime);
}

model SendSmsRequest {
  nowStamp?: long(name='NowStamp'),
  phoneNumbers?: string(name='PhoneNumbers'),
  signKey?: string(name='SignKey'),
}

model SendSmsResponseBody = {
  data?: boolean(name='Data'),
  errorCode?: int32(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  httpCode?: int32(name='HttpCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SendSmsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SendSmsResponseBody(name='body'),
}

async function sendSmsWithOptions(request: SendSmsRequest, runtime: Util.RuntimeOptions): SendSmsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nowStamp)) {
    query['NowStamp'] = request.nowStamp;
  }
  if (!Util.isUnset(request.phoneNumbers)) {
    query['PhoneNumbers'] = request.phoneNumbers;
  }
  if (!Util.isUnset(request.signKey)) {
    query['SignKey'] = request.signKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendSms',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendSms(request: SendSmsRequest): SendSmsResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendSmsWithOptions(request, runtime);
}

model SyncInfoRequest {
  accountNo?: string(name='AccountNo'),
  bizId?: string(name='BizId'),
  chainValue?: string(name='ChainValue'),
  componentIdList?: string(name='ComponentIdList'),
  createUser?: string(name='CreateUser'),
  id?: long(name='Id'),
  mainId?: long(name='MainId'),
  name?: string(name='Name'),
  nextChainValue?: string(name='NextChainValue'),
  ossFileUrl?: string(name='OssFileUrl'),
  pageId?: string(name='PageId'),
  status?: int32(name='Status'),
  updateUser?: string(name='UpdateUser'),
  url?: string(name='Url'),
  urlType?: int32(name='UrlType'),
}

model SyncInfoResponseBody = {
  code?: int32(name='Code'),
  data?: {
    id?: long(name='Id'),
  }(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SyncInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SyncInfoResponseBody(name='body'),
}

async function syncInfoWithOptions(request: SyncInfoRequest, runtime: Util.RuntimeOptions): SyncInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountNo)) {
    query['AccountNo'] = request.accountNo;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.chainValue)) {
    query['ChainValue'] = request.chainValue;
  }
  if (!Util.isUnset(request.componentIdList)) {
    query['ComponentIdList'] = request.componentIdList;
  }
  if (!Util.isUnset(request.createUser)) {
    query['CreateUser'] = request.createUser;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.mainId)) {
    query['MainId'] = request.mainId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.nextChainValue)) {
    query['NextChainValue'] = request.nextChainValue;
  }
  if (!Util.isUnset(request.ossFileUrl)) {
    query['OssFileUrl'] = request.ossFileUrl;
  }
  if (!Util.isUnset(request.pageId)) {
    query['PageId'] = request.pageId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.updateUser)) {
    query['UpdateUser'] = request.updateUser;
  }
  if (!Util.isUnset(request.url)) {
    query['Url'] = request.url;
  }
  if (!Util.isUnset(request.urlType)) {
    query['UrlType'] = request.urlType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SyncInfo',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function syncInfo(request: SyncInfoRequest): SyncInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return syncInfoWithOptions(request, runtime);
}

model UpdateAdxCreativeContentRequest {
  ad?: [ 
    {
      bundle?: [ string ](name='Bundle'),
      clicks?: [ string ](name='Clicks'),
      crid?: string(name='Crid'),
      enddate?: string(name='Enddate'),
      imps?: [ string ](name='Imps'),
      interacttype?: int32(name='Interacttype'),
      mediaIdList?: [ string ](name='MediaIdList'),
      nativead?: [ 
        {
          attrname?: string(name='Attrname'),
          attrvalue?: string(name='Attrvalue'),
          h?: int32(name='H'),
          mime?: string(name='Mime'),
          w?: int32(name='W'),
        }
      ](name='Nativead'),
      op?: int32(name='Op'),
      ostype?: string(name='Ostype'),
      prereview?: boolean(name='Prereview'),
      seat?: string(name='Seat'),
      startdate?: string(name='Startdate'),
      template?: int32(name='Template'),
      type?: int32(name='Type'),
    }
  ](name='Ad'),
  dspId?: string(name='DspId'),
}

model UpdateAdxCreativeContentResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  status?: int32(name='Status'),
}

model UpdateAdxCreativeContentResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAdxCreativeContentResponseBody(name='body'),
}

async function updateAdxCreativeContentWithOptions(request: UpdateAdxCreativeContentRequest, runtime: Util.RuntimeOptions): UpdateAdxCreativeContentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ad)) {
    query['Ad'] = request.ad;
  }
  if (!Util.isUnset(request.dspId)) {
    query['DspId'] = request.dspId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAdxCreativeContent',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAdxCreativeContent(request: UpdateAdxCreativeContentRequest): UpdateAdxCreativeContentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAdxCreativeContentWithOptions(request, runtime);
}

model VerifyAdvertisingRequest {
  app?: {
    ext?: map[string]any(name='Ext', description='ext'),
    mediaid?: string(name='Mediaid', description='mediaid', example='234546546'),
    sn?: string(name='Sn', description='sn', example='testSn'),
  }(name='App', description='app'),
  dealtype?: int32(name='Dealtype', example='1'),
  device?: {
    androidid?: string(name='Androidid', description='androidid', example='androidid'),
    androidmd5?: string(name='Androidmd5', description='androidmd5', example='androidmd5'),
    caid?: string(name='Caid', description='Caid', example='Caid'),
    carrier?: string(name='Carrier', example='TELECOM'),
    connectiontype?: int32(name='Connectiontype', example='1'),
    devicetype?: int32(name='Devicetype', description='deviceType', example='2'),
    geo?: {
      city?: string(name='City'),
      district?: string(name='District'),
      lat?: double(name='Lat', description='lat', example='23.5646'),
      lon?: double(name='Lon', description='lon', example='123.53453'),
      province?: string(name='Province'),
    }(name='Geo'),
    idfa?: string(name='Idfa', description='Idfa', example='Idfa'),
    imei?: string(name='Imei', description='imei', example='8605210594812500'),
    imeimd5?: string(name='Imeimd5', description='imeimd5', example='sdffgdghgcx'),
    ip?: string(name='Ip', example='172.26.60.154'),
    language?: string(name='Language', example='cn'),
    mac?: string(name='Mac', example='e8fdf8b3cf9a'),
    macmd5?: string(name='Macmd5', description='Macmd5', example='Macmd5'),
    make?: string(name='Make', description='make', example='rewr'),
    model?: string(name='Model', description='model', example='fdsf'),
    oaid?: string(name='Oaid', description='oaid', example='dsgfsg'),
    os?: string(name='Os', description='os', example='ios'),
    osv?: string(name='Osv', description='osv', example='gh'),
    ua?: string(name='Ua', description='ua', example='dsf'),
    utdid?: string(name='Utdid', description='Utdid', example='11148984'),
  }(name='Device', description='device'),
  ext?: map[string]any(name='Ext', description='ext', example='{}'),
  id?: string(name='Id', description='id', example='acbef-345-6546'),
  imp?: [ 
    {
      id?: string(name='Id', description='id', example='1'),
      tagid?: string(name='Tagid', description='tagid', example='7857789563'),
    }
  ](name='Imp', description='imp'),
  test?: int32(name='Test', description='test', example='0'),
  user?: {
    id?: string(name='Id', description='uid', example='208834564534'),
    usertype?: string(name='Usertype', description='uidtype', example='ALIPAY_OPEN_ID'),
  }(name='User', description='user'),
  verifyad?: [ 
    {
      id?: string(name='Id', example='44'),
      seat?: string(name='Seat', example='4534523'),
    }
  ](name='Verifyad'),
}

model VerifyAdvertisingShrinkRequest {
  appShrink?: string(name='App', description='app'),
  dealtype?: int32(name='Dealtype', example='1'),
  deviceShrink?: string(name='Device', description='device'),
  extShrink?: string(name='Ext', description='ext', example='{}'),
  id?: string(name='Id', description='id', example='acbef-345-6546'),
  impShrink?: string(name='Imp', description='imp'),
  test?: int32(name='Test', description='test', example='0'),
  userShrink?: string(name='User', description='user'),
  verifyadShrink?: string(name='Verifyad'),
}

model VerifyAdvertisingResponseBody = {
  errorcode?: string(name='Errorcode', description='errorCode', example='P1001'),
  errormsg?: string(name='Errormsg', description='errorMsg', example='error'),
  ext?: map[string]string(name='Ext', description='ext'),
  header?: {
    costTime?: long(name='CostTime', description='costTime', example='19'),
    rpcId?: string(name='RpcId', description='rpcId', example='xhx3mwagszdxb5lf'),
    traceId?: string(name='TraceId', description='traceId', example='xhx3mwa'),
    version?: string(name='Version', description='version', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
  }(name='Header', description='header'),
  requestId?: string(name='RequestId', example='A53EB3C4-DD25-5B90-9029-4A414877CFFB'),
  result?: {
    bidid?: string(name='Bidid', example='9885db29-3406-456f-8160-2b8dfc42c1df'),
    id?: string(name='Id', description='id', example='32'),
    seatbid?: [ 
      {
        bid?: [ 
          {
            ads?: [ 
              {
                crid?: string(name='Crid', description='crid', example='23435345'),
                crurl?: string(name='Crurl', example='www.taobao.com'),
                icon?: {
                  url?: string(name='Url', example='https://market.m.taobao.com/app/alicloud-tools/base-h5/index.html?rootId=16022413&appId=100100100100&pageId=page_0d884ec7&BusinessId=yc-165407506207478-165511576113195&preview=true&cid=32'),
                }(name='Icon'),
                id?: string(name='Id', example='51313927061504'),
                images?: [ 
                  {
                    desc?: string(name='Desc', example='caozhen_test'),
                    format?: string(name='Format', example='JPEG'),
                    url?: string(name='Url', example='https://market.m.taobao.com/app/alicloud-tools/base-h5/index.html?rootId=16022413&appId=100100100100&pageId=page_63b9b362&BusinessId=yc-165407506207478-165511576113195&preview=true&cid=31'),
                  }
                ](name='Images'),
                interacttype?: int32(name='Interacttype', description='Interacttype', example='1'),
                labeltype?: string(name='Labeltype'),
                landingurls?: [ string ](name='Landingurls'),
                marketingtype?: string(name='Marketingtype', example='OnlineStoreMember'),
                objective?: string(name='Objective', example='SINGLE_ACQUISITION'),
                price?: string(name='Price', example='805.22'),
                seat?: string(name='Seat', description='seat', example='645534523'),
                style?: string(name='Style', example='1302'),
                title?: string(name='Title'),
                trackers?: {
                  imps?: [ string ](name='Imps'),
                }(name='Trackers'),
                type?: string(name='Type', example='5'),
              }
            ](name='Ads'),
            impid?: string(name='Impid', description='impId', example='53453423'),
          }
        ](name='Bid', description='bid'),
      }
    ](name='Seatbid'),
  }(name='Result'),
  success?: boolean(name='Success', description='success', example='True'),
}

model VerifyAdvertisingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VerifyAdvertisingResponseBody(name='body'),
}

async function verifyAdvertisingWithOptions(tmpReq: VerifyAdvertisingRequest, runtime: Util.RuntimeOptions): VerifyAdvertisingResponse {
  Util.validateModel(tmpReq);
  var request = new VerifyAdvertisingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.device)) {
    request.deviceShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.device, 'Device', 'json');
  }
  if (!Util.isUnset(tmpReq.ext)) {
    request.extShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ext, 'Ext', 'json');
  }
  if (!Util.isUnset(tmpReq.imp)) {
    request.impShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.imp, 'Imp', 'json');
  }
  if (!Util.isUnset(tmpReq.user)) {
    request.userShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.user, 'User', 'json');
  }
  if (!Util.isUnset(tmpReq.verifyad)) {
    request.verifyadShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.verifyad, 'Verifyad', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyAdvertising',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifyAdvertising(request: VerifyAdvertisingRequest): VerifyAdvertisingResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyAdvertisingWithOptions(request, runtime);
}

model VerifySmsCodeRequest {
  code?: string(name='Code'),
  nowStamp?: long(name='NowStamp'),
  phoneNumbers?: string(name='PhoneNumbers'),
  signKey?: string(name='SignKey'),
}

model VerifySmsCodeResponseBody = {
  code?: int32(name='Code'),
  data?: boolean(name='Data'),
  errorMessage?: string(name='ErrorMessage'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model VerifySmsCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VerifySmsCodeResponseBody(name='body'),
}

async function verifySmsCodeWithOptions(request: VerifySmsCodeRequest, runtime: Util.RuntimeOptions): VerifySmsCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.nowStamp)) {
    query['NowStamp'] = request.nowStamp;
  }
  if (!Util.isUnset(request.phoneNumbers)) {
    query['PhoneNumbers'] = request.phoneNumbers;
  }
  if (!Util.isUnset(request.signKey)) {
    query['SignKey'] = request.signKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifySmsCode',
    version = '2022-07-04',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifySmsCode(request: VerifySmsCodeRequest): VerifySmsCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifySmsCodeWithOptions(request, runtime);
}

